<script setup lang="ts">
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { registerTheme } from 'echarts/core'
import chalkChartTheme from './config/modules/chalk-chart-theme'

const { isAnimate, animateOptions } = storeToRefs(
  useLayoutStore(),
)

// 全局主题
useDesignStore()

// 覆盖echarts内置的dark
registerTheme('dark', chalkChartTheme)
</script>

<template>
  <ElConfigProvider
    :locale="zhCn"
    :message="{ max: 3 }"
    :value-on-clear="(null as any)"
    :empty-values="[null, undefined]"
  >
    <RouterView />
    <!-- 动画 -->
    <BLoading
      v-model="isAnimate"
      v-bind="animateOptions"
    />
  </ElConfigProvider>
</template>
